package com.feign;

import com.pojo.User;
import feign.hystrix.FallbackFactory;

import java.math.BigDecimal;

/**
 * @Author : FMH
 * @Date : 2020/2/24 16:03
 * @Description :
 * @Modify By : 86159
 * @Version :
 */
public class UserFeignServiceFallBackFactory implements FallbackFactory<UserFeignService> {
    @Override
    public UserFeignService create(final Throwable throwable) {
        return new UserFeignService() {
            @Override
            public User get(Long id) {
                return new User(id,"请求异常,请稍后再试!",throwable.getMessage(),0,new BigDecimal(0.00));
            }
        };
    }
}
